<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0px;padding: 0px;
        }
        #app{
            padding: 20px 10px;
        }
        h4{
            position: absolute;
            left: 10px;
            top: 20px;
        }
        button{
            position: absolute;
            right: 10px;
            top: 20px;
        }
        ul,li{
            list-style: none;
        }
        ul{
            margin-top: 60px; 
        }
        ul>li{
            display: flex;
            margin: 10px 0px;
            position: relative;
        }
        ul img{
            width: 40%;
        }
        ul .right{
            margin-left: 20px;
        }
        ul .right>.p2{
            position: absolute;
            bottom: 0px;
        }
        ul .right>.p3{
            position: absolute;
            bottom: 0px;
            right: 0px;
        }
    </style>
</head>
<body>
    <div id="app">
        <h4>已选商品</h4>
        <button>清空</button>
        <ul>
            <li v-for="(item,index) in listArr">
               <img :src="item.pic" alt=""> 
               <div class="right">
                <p class="p1">{{item.name}}</p>
                <p class="p2">
                    <span>{{item.price}}<del>{{item.dprice}}</del></span>
                </p>
                <p class="p3">
                    <input type="button" value="-" @click="goodsNum1(item.num)">
                    <span>{{item.num}}</span>
                    <input type="button" value="+" @click="goodsNum2">
                </p>
               </div>
            </li>
        </ul>
        <div class="sum">
            <span>总价</span>
            <span>去结算</span>
        </div>
    </div>
</body>
</html>
<script src="../vue-2.5.21.js"></script>
<script src="./02_demo.js"></script>